System and method of selecting level of detail in texture mapping

ABSTRACT

A system and method of selecting a level of detail in a texture-mapping system. Pixels are processed in a zig-zag traversal pattern to allow determination of vertical and horizontal change values in texture map coordinates. In this manner, accurate level of detail selection is achieved without unduly reducing efficiency or throughput of the graphics system.

CROSS-REFERENCE TO RELATED APPLICATION

The present application is related to U.S. application Ser. No.09/057,393, Malamy et al., "Polygon Rendering Method And System WithDedicated Setup Engine", filed Apr. 8, 1998 the disclosure of which isincorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to texture mapping in graphicssystems, and more particularly to a system and method of selecting alevel of detail for texture mapping operations.

2. Description of Background Art

Texture mapping is a well known technique in computer-implementedgraphics systems. In general, texture mapping involves mapping atwo-dimensional image ("texture") onto a selected region in a framebuffer or other two-dimensional space. The selected region mayrepresent, for example, a projection of a surface in three-dimensionalspace. In such a situation, texture mapping is often used to convey theimpression that the surface is a component of a solid object inthree-dimensional space, having surface characteristics corresponding tothe defined texture.

In principle, the concept of texture mapping operates as follows. Thesurface to be rendered contains a number of individual picture elements("pixels"), that may be identified by reference to their coordinates(x,y) in two-dimensional screen space. The texture to be mapped onto thesurface contains a number of individual texture elements ("texels"),that may be identified by reference to their coordinates (u,v) intwo-dimensional texture space. Each texel has certain material valuessuch as color, luminance, and the like, defined by the texture stored inthe texture map.

Each pixel in the surface to be rendered is mapped to a particulartexel, and the material values associated with that texel are applied tothe pixel. In some situations, values may be interpolated and/orfiltered among two or more texels for application to a pixel. Since thesurface and the texture may be of differing shapes and sizes, theprocess of applying the texture to the surface often involves scalingand interpolation. In particular, when the surface being rendered isrepresentative of a three-dimensional surface, perspective correctionand other distortion techniques are applied in order to provide arealistic appearance.

In many situations, the process of scaling a texture in order to applyit to a surface may be computationally expensive. Typically, suchscaling is accomplished by filtering, or averaging, material values fora number of texels in order to derive a material value to be applied toa pixel. Where the scaling factor is significant, such filteringtechniques are often too slow for realtime rendering operations.

Accordingly, it is known in the art to provide several versions of atexture map, each associated with a different level of detail (LOD).These versions are usually developed a priori, so that they may beavailable as needed during rendering operations. During rendering, thesystem selects the LOD most suitable for rendering a particular pixel,so as to reduce the complexity of scaling operations that need to beperformed. Generally, such selection is performed based on the relativearea of the surface being rendered, as compared with the size of thetexel to be mapped. The smaller the area, corresponding to a smallertotal number of pixels in the surface, the lower the level of detailselected.

Once an LOD has been selected, any of a number of techniques may be usedfor filtering of the texture. These techniques determine a materialvalue to be applied to a pixel at a particular x,y coordinate thatcorresponds to a u,v position in the texture. For example, any of thefollowing four techniques, among others, are in general use, dependingon the application and the limitations of the particular system:

Point sampling (the nearest LOD is selected, and the material value forthe nearest texel to position u,v is used)

Linear filtering (the nearest two LODs are selected; material values forthe nearest texel to position u,v in each LOD are determined; a weightedaverage between the two material values, weighted by the relativeproximity to each LOD, is used)

Bilinear filtering (the nearest LOD is selected, and the material valuesfor the four nearest texels to position u,v are subject to weightedaveraging based on the exact value of u,v; the weighted average is used)

Trilinear filtering (the above-described bilinear filtering technique isapplied to the nearest two LODs; a weighted average between the tworesults, weighted by the relative proximity to each LOD, is used)

Whichever of the above techniques is used, the system must first selectan appropriate LOD to be used for each pixel to be rendered. One knowntechnique for LOD selection is to measure the distance in texture spacecoordinates (u,v) that corresponds to a unit distance in screen spacecoordinates (x,y). A large change in texture space coordinates indicatesthat the texture can be traversed in fewer unit steps, and therefore asmaller LOD should be used. Conversely, a small change in texture spacecoordinates indicates that a larger LOD should be used.

The distance in texture space coordinates corresponding to a unitdistance in screen space is expressed as (Δu,Δv). Graphics systemsgenerally select LOD for a given pixel (x,y) by taking the base-twologarithm of the largest measured value of Δu or Δv surrounding point(x,y). Ideally, all Δu and Δv values for a unit circle (in screen space)around point (x,y) would be measured and the largest value taken.However, due to the impracticality of computing Δu and Δv for all pointsaround a unit circle, most graphics systems sample discrete points.Typically, a pixel directly above and/or below the point (i.e. (x,y-1)and/or (x,y+1)), and a pixel directly horizontally adjacent to the point(i.e. (x-1,y) and/or (x+1,y)) are used. Some systems also use the pixelsdiagonally adjacent to the point (i.e. (x-1,y-1), (x-1,y+1), (x+1,y-1),and/or (x+1,y+1)) and scale down to take into account that such pixelsdo not lie on the unit circle.

All of the above techniques introduce computational complexity due tothe fact that each measurement of Δu and Δv requires a significantamount of calculation. Typically, in order to determine u and v valuesfor a given pixel, two additions, two multiplications, and one divisionare required. On the other hand, a sufficient number of such comparisonsare required in order to facilitate satisfactory LOD selection. Thus, inmany systems, LOD selection is compromised by the fact that aninsufficient number of Δu and Δv values are available. Conversely, somesystems are able to perform the additional computations for moreaccurate LOD selection, but such systems generally require relativelypowerful processors.

What is needed is a system and method of determining a sufficient numberof Δu and Δv values surrounding a given pixel to provide effectiveselection of LOD, without introducing undue computational expense.

SUMMARY OF THE INVENTION

In accordance with the present invention, there is provided a system andmethod of LOD selection that significantly reduces the computationalexpense associated with determining Δu and Δv values, and therebyimproves performance. Pixels are processed in a zigzag pattern to takeadvantage of pipelining techniques. LOD selection for a particular pixelis deferred until u and v values for two succeeding pixels have beendetermined. Since these u and v values may then be reused in renderingother pixels, the present invention minimizes the additional burdeninvolved in LOD selection.

LOD selection is based on two pairs of Δu and Δv values: a horizontalpair representing texture map distance associated with a unit movementin the horizontal direction in screen space; and a vertical pairrepresenting texture map distance associated with a unit movement in thevertical direction in screen space. The system employs a zigzagtraversal pattern in screen space, so that a given pixel is followed bytwo succeeding pixels, each representing movement along one of the twoaxes. By delaying LOD determination until two succeeding pixels havebeen processed, the system has at its disposal the data required tomeasure the values for the desired two pairs of Δu and Δv values. Thetwo pairs of values may then be processed to obtain the largest deltavalue, and the base-two logarithm of this value may be used for LODselection.

By using the above-described technique, the system and method of thepresent invention are able to provide accurate selection of anappropriate LOD without introducing significant additional complexity tothe rendering process.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a system for practicing the presentinvention.

FIG. 2 is a diagram of an overall pipeline of a polygon renderingmodule.

FIGS. 3A and 3B show an example of texture mapping.

FIGS. 4A and 4B show an example of a texture being applied at differingsizes.

FIG. 5 shows an example of a primitive having pixels with associated(u,v) values.

FIG. 6 shows a texture stored at three levels of detail.

FIG. 7 shows a straight-line traversal path along a span.

FIG. 8 shows a zig-zag traversal path along two spans.

FIG. 9A shows an example of a span having one pixel.

FIG. 9B shows an example of a span having an even number of pixels.

FIG. 10A shows an alternate zig-zag traversal path.

FIG. 10B shows a second alternate zig-zag traversal path.

FIG. 11 is a flowchart showing a method of practicing the presentinvention.

DETAILED DESCRIPTION OF THE INVENTION

Referring now to FIG. 1, there is shown a block diagram of a system 100for practicing the present invention. System 100 is typicallyimplemented on a graphics device such as a Silicon Graphics Workstation,or on a graphics card included in a computer system such as a personalcomputer having an Intel Pentium™ processor and running the Windows™ 95operating system from Microsoft Corporation. Polygon rendering module102 generates pixel values using stored polygon descriptions 101containing material values at polygon vertices. Module 102 may alsoimplement projection algorithms that are known in the art in order toconvert three-dimensional representations into two-dimensionalprojections for representation in frame buffer memory 105.

Texture mapping module 104 is provided to improve the appearance ofprojected polygons by applying surface features. Module 104 readstexture maps 103 containing texture images and provides projectionsaccording to known texture mapping techniques. Module 102 providesmodule 104 with texture coordinates associated with each pixel to bedrawn on the screen. Module 102 also uses output of module 104 inrendering polygons. In one embodiment, the techniques of the presentinvention are implemented within texture mapping module 104.

Frame buffer memory 105 is conventional memory that may be optimized forstorage of image data. Memory 105 typically contains a plurality ofmemory locations, each representing a pixel in the image to bedisplayed. Each location of memory 105 contains relevant informationdescribing the appearance of the corresponding pixel, such as a colorvalue. Display 106, which may be a conventional cathode-ray tube orother type of output device, presents the contents of some portion ofmemory 105 to the user.

The block diagram of FIG. 1 illustrates merely one possible structuralscheme for implementing the present invention. Those skilled in the artwill recognize that other architectures may be used without departingfrom the spirit or essential characteristics of the invention.

Referring now to FIG. 2, there is shown a diagram of the overallpipeline of a polygon rendering module 102 according to one embodimentof the present invention. The components shown in FIG. 2 are conceptualfunctional units, which may be implemented as discrete physicalcomponents, or as part of a single overall hardware or software element.For illustrative purposes, the pipeline operation of module 102 isdescribed in terms of operation on a single triangular primitive.However, the present invention is able to operate on any number ofprimitives simultaneously, and other primitive shapes may be employed.Detailed operation of the pipeline of FIG. 2 may be implemented, forexample, as disclosed in related U.S. application Ser. No. 09/057393,Malamy et al., "Polygon Rendering Method And System With Dedicated SetupEngine", filed Apr. 8, 1998.

Vertex unit 201 autonomously reads data describinrg material values ateach vertex of a polygon. Material values may include, for example, xand y coordinates, color values, texture, luminance, and the like. Thesevalues are read from memory in a conventional manner. In one embodiment,vertex unit 201 obtains these values from stored polygon descriptions101, though some of the values may be derived or calculated by knownprojection, interpolation, or other methods. Vertex unit 201 thenprovides coordinate values and other material values for each of thevertices of the triangle being rendered.

The output of vertex unit 201, including for example x and ycoordinates, color, texture, and the like, are passed to setup unit 202.Setup unit 202 operates as described in the related U.S. patentapplication, and generates values that may be of use in subsequentprocessing. Edge walk module 203 accepts the output of setup unit 202and determines a starting pixel for each span of the triangle, where aspan is a horizontal row of pixels lying within the bounds of thetriangle. Module 203 also determines material values for the startingpixel.

Values determined by edge walk module 203 are passed to span walk module204. Span walk module 204 also accepts the gradients determined by setupunit 202. Module 204 then walks horizontally along the span, determiningvalues for all pixels in the span. As span walk module 204 passes alongeach pixel, it determines material values for the pixel and passes suchvalues down the pipeline to other components 205. Other components 205are conventional graphics processing components, such as modules forz-buffering, texturing, blending, and the like, as are known in the art.

Texture mapping module 104 performs operations associated with applyinga stored texture map 103 to a polygon. Such texture mapping operationsare employed in order to lend greater realism to a three-dimensionalscene being rendered by applying a two-dimensional image to one or moreof the surfaces of the scene. Texture mapping is well-known in the art,and is often used as an expedient alternative to separate rendering andmodeling of each component of the scene on an individual basis.

For example, as shown in FIGS. 3A and 3B, mapping texture 301 ontosurface 303 provides an alternative to separate modeling and renderingof each individual brick as a three-dimensional object. A stored texture301 containing a two-dimensional representation of bricks is mapped ontoa rectangular surface 303 in a three-dimensional scene 302 in order togive the impression that surface 303 is made of bricks. Surface 303 maycontain several copies of texture 301, as is shown in the example, inorder to provide coverage for the entire surface.

As described above, each pixel in the surface to be rendered is mappedto a particular texel or to a filtered group of texels, and the materialvalues associated with that texel or filtered group are applied to thepixel. In order to facilitate mappings onto a wide range of surfacessizes, texture map 301 may be stored at several levels of detail (LODs).Referring now to FIG. 6, there is shown a conceptual diagram of atexture stored at three LODs 601, 602, and 603. Each LOD is associatedwith a value, designated d, representing the perceived distanceassociated with that particular LOD. The d value, which is proportionalto the base-two logarithm of a corresponding LOD's dimension, may beused to identify a particular LOD. Other dimensions and bases may alsobe used.

In addition, there is shown an interpolated LOD 604 that may bedeveloped and used when the surface to which the texture is being mappeddictates that an intermediate size is needed. In developing aninterpolated LOD, texture mapping module 104 selects the closest storedLOD to the desired LOD and applies a filtering method to derive theinterpolated LOD. As described above, such filtering method may includeany of several known techniques, including for example point-sampling,linear, bilinear, or trilinear methods.

Referring now to FIGS. 4A and 4B, there is shown an example of texture301 being applied to scene 302 having a number of surfaces 303A-J withvarying sizes. For small surfaces, such as 303G, a smaller LOD would bemore appropriate. Although a larger LOD could be used for all thesurfaces shown in scene 302, significant computational savings can beaccomplished by using several LODs for various portions of the image, inorder to limit the amount of filtering required.

Selection of an appropriate LOD from which to begin filtering typicallydepends upon the overall size of the surface being rendered. Where theshape of the surface indicates that distortion of the texture iswarranted, different LODs may be employed for different portions of thetexture. For example, referring again to FIG. 3B, the far right sectionof surface 303 gives the impression of receding into the distance in thethree-dimensional scene 302; therefore that section of surface 303 mayemploy a smaller LOD than would the leftmost section.

LOD selection operates as follows. During rendering, edge walk module203 and span walk module 204 iterate down edges and along spans ofprimitives such as triangles, determining material values for each pixelin turn. As described in the related application, values to bedetermined for each succeeding pixel may include, for example, color andz-coordinate data (for z-buffering). When texture mapping is beingperformed, a texture coordinate value is also associated with each pixellocation in the primitive. The texture coordinates associated with aparticular pixel (x,y) are designated as (u,v). Thus, in order todetermine a particular texel to be mapped to pixel (x,y), texturemapping module 104 performs an indexed read operation into theappropriate LOD of texture map 301, using derived values for (u,v), inorder to retrieve the appropriate texel value for application (withassociated filtering, if needed) to pixel (x,y).

Selection of an appropriate LOD may therefore be accomplished bydetermining the distance traversed in texture space associated with aone-pixel traversal in screen space. Referring now to FIG. 5, there isshown a scene 302 containing a primitive 501. Primitive 501 contains anumber of pixels 501, each of which may be identified by position withrespect to the x- and y-axes. For each pixel (x,y), a correspondingposition (u,v) in texture space may be identified using known mappingtechniques.

Thus, in the enlarged detail of FIG. 5, the center pixel 502, havingscreen coordinates of (x,y), is associated with texture coordinatesdesignated (u_(x),y, v_(x),y). The pixel 502 immediately to the right ofthe center pixel 502 has screen coordinates (x+1,y) and is thereforeassociated with texture coordinates designated (u_(x+1),y, v_(x+1),y).Other pixels 502 are labeled accordingly.

To determine which LOD is appropriate for texture mapping a particularpixel, the (u,v) values associated with the pixel are compared with the(u,v) values associated with points located a unit distance away fromthe pixel, such as those located on unit circle 503 surrounding thepixel. The change in (u,v) values corresponding to such a one-pixelshift is designated as (Δu,Δv). Where the values of Δu and Δv are large,a smaller LOD is used. Conversely, where the values of Δu and Δv aresmall, a larger LOD is used.

Typically, the values of Δu and Δv are not constant for every pointaround the unit circle, particularly where the texture is beingdistorted in order to fit a surface having irregular shape, or in orderto provide perspective correction. In many situations, the value of Δuand Δv corresponding to a horizontal movement (Δu_(horiz), Δv_(horiz))is not equal to the value of Δu and Δv corresponding to a verticalmovement (Δu_(vert), Δv_(vert)).

In one embodiment, the present invention employs a technique wherein thelargest value of the set {Δu_(horiz), Δv_(horiz), Δu_(vert), Δv_(vert) }is used to determine LOD. Values for Δu and Δv for other points aroundthe unit circle may also be determined, though each additional suchcalculation generally introduces additional computational overhead andresults in poorer performance.

Referring now to FIG. 7, there is shown an example of (Δu, Δv)determination along a span of a primitive. As described above, span walkmodule 204 processes each pixel 502 of span 701 in turn, determiningmaterial values and texture coordinates (u,v). For example, when spanwalk module 204 is processing pixel (x,y), it determines texturecoordinates (u_(x),y, v_(x),y). In order to determine values forΔu_(horiz) and Δv_(horiz), texture map module 104 compares (u_(x),y,v_(x),y) with (u_(x+1),y, v_(x+1),y). Since these values areconveniently associated with the next pixel to be processed by module204, module 104 can obtain access to these values by waiting one cyclein the rendering process.

By employing pipelining operations as described above and as known inthe art, LOD selection may be deferred until values for (u_(x+1),y,v_(x+1),y) have been determined for the next pixel in span 701. Sincethese values need to be determined anyway for conventional span walkingand texture mapping, no additional computational overhead is needed(other than the simple subtraction required to determine Δu_(horiz)=u_(x+1),y -u_(x),y and Δv_(horiz) =v_(x+1),y -v_(x),y).

As can be seen from FIG. 7 values for Δu_(vert) and Δv_(vert) dependupon values associated with a pixel 703 in the next span 702. If pixelsare traversed along one span before proceeding to the next span, as isconventional in the art, the values needed to determine Δu_(vert) andΔv_(vert) may not be made available by simple deferral until the nextpixel in a span has been processed. In fact, the values for the nextspan 702 will not be available until edge walk module 203 has proceededto that span. Typically, this entails significant delay, making itimpractical to defer LOD selection until the appropriate pixel has beenprocessed.

Referring now to FIG. 8, there is shown a zig-zag traversal path acrosstwo spans 701, 702. By using this traversal path, the present inventionimplements LOD selection employing both vertical and horizontal Δu andΔv values without introducing significant additional computationalcomplexity or delay.

In one embodiment, the invention operates as follows. In order toperform LOD selection for the pixel designated (x₁, y₁), the inventionuses three sets of (u,v) values:

(u₁, v₁), corresponding to the pixel (x₁, y₁);

(u₂, v₂), corresponding to the pixel (x₂, y₂)=(x₁, y₁₊₁) (the pixelimmediately below (x₁, y₁));

(u₃, v₃), corresponding to the pixel (x₃, y₃)=(x₁ +2, y₁) (the pixel twounits to the right of (x₁, y₁));

By employing the traversal path shown, these three sets of (u,v) valuesare made available by delaying LOD selection for two cycles. For anypoint in span 701, the values for (u,v) needed to determine Δu and Δv inthe vertical and horizontal directions are available within two cycles.Conventional pipelining techniques may be employed to implement such adelay.

Once the three sets of (u,v) values are known, the Δu and Δv values aredetermined by:

Δu_(vert) =u₂ -u₁

Δv_(vert) =v₂ -v₁

Δu_(horiz) =(u₃ -u₁)/2

Δv_(horiz) =(v₃ -v₁)/2

In one embodiment, values for Δu_(horiz) and Δv_(horiz) are determinedbased on a pixel two units to the right of the current pixel. This is anapproximation which has been found to have little detrimental effectupon the quality of the image. The (u,v) values for skipped pixels areestimated by averaging the values for the two pixels on either side. Forthese skipped pixels, the same LOD is selected as was used for theimmediately preceding pixel. For the last pixel in a span, thepreviously obtained LOD selection is re-used.

Material value determination for color, z-value, and the like, isperformed by conventional means along a single span without skippingpixels. This may take place in parallel with the zig-zag traversal beingperformed for LOD determination.

Referring now to FIG. 11, there is shown a flowchart of a method ofoperation according to one embodiment of the invention. For ease ofillustration, the flowchart of FIG. 11 displays steps in a linearfashion, without showing the parallelism inherent in the pipelinedarchitecture described above. However, one skilled in the art willrecognize that the steps of FIG. 11 can be implemented in parallel formso as to improve performance by determining LOD for one pixel whileanother pixel is being rendered. In addition, the order in which thesteps are performed can be altered without departing from the spirit oressential characteristics of the present invention.

Span walk module 204 begins 1101 processing a span. The first pixel isselected 1102 and its coordinates are designated (x,y). Module 204 thendetermines 1103 (u,v) coordinates in texture space, as well as materialvalues, for pixel (x,y). Module 204 then determines 1104 (u,v)coordinates for pixel (x,y+1) located immediately below the pixel beingprocessed. Rendering operations based on material values determined instep 1103 may be performed in parallel with this step. Module 204 thendetermines 1105 material values for pixel (x+1,y) and performs renderingoperations based on these material values. This is part of theconventional straight-line processing of material values that occurs inparallel with the zig-zag traversal being used for LOD determination.

Module 204 then determines 1106 (u,v) coordinates for pixel (x+2,y).Using the (u,v) values determined in steps 1103, 1104, and 1106, module204 then determines 1107 Δu and Δv values in the horizontal and verticaldirection, using the equations described previously in connection withFIG. 8. Module 204 then uses the maximum Δ value to select 1108 an LODfor pixel (x,y). This may be done by taking the base-two logarithm ofthe maximum Δ value. Using the selected LOD, texture map module 104retrieves 1109 the relevant portion of the appropriate version of thetexture map, and performs filtering if necessary to determine values tobe applied at pixel (x,y). Module 104 then performs 1110 the sameoperation on pixel (x+1,y), using the same LOD that was selected forpixel (x,y).

If in 1111 the end of the span has been reached, span walk module 204proceeds 1112 to the next span.

If in 1111 the end of the span has not been reached, module 204increments 1113 x by 2 to continue the zig-zag traversal path. Valuesfor (u,v) applicable to the new (x,y) pixel need not be recalculated;since they were previously determined in 1106, they are retrieved 1114for re-use. Module 204 then determines 1115 material values for pixel(x,y), and performs associated rendering operations, a step that maytake place in parallel with LOD determination. Module 204 then returnsto 1104 and performs steps 1104 though 1110 to continue LODdetermination and mapping for the new pixel.

In certain special cases, deviations from the above-described zig-zagtraversal path are employed. Referring now to FIG. 9A, there is shown anexample of a primitive 901 having a span 902 containing a single pixel904. In such a case, span 902 does not contain any other pixelsavailable to develop Δu and Δv for the horizontal direction. In oneembodiment, texture mapping module 104 uses a pixel 906 located outsidethe bounds of primitive 901 in order to determine Δu and Δv. Althoughpixel 906 is not normally rendered, since it lies outside the bounds ofprimitive 901 and is not part of span 902, the (u,v) values for pixel906 are useful in performing LOD selection for pixel 904. As long asaccessing pixel 906 does not generate an overflow condition, its (u,v)values are therefore usable for Δu and Δv determination in thehorizontal direction. This determination also avoids the division by twodescribed above in connection with FIG. 8. Pixel 905 is also used, inthe manner as described previously, for determination of Δu and Δv inthe vertical direction.

Referring now to FIG. 9B, there is shown a special case wherein the span909 being processed contains an even number of pixels. In oneembodiment, the final pixel 911 in span 909 is reached by moving to theright one pixel instead of two. Thus, the determination of Δu and Δv inthe horizontal direction for pixel 911 is performed without the divisionby two shown above.

In an alternative embodiment, a zig-zag traversal path is employed thatdoes not skip pixels in the horizontal direction. Referring now to FIG.10A, there is shown an example of such a traversal path as applied tospans 701 and 702 in turn. Once span walk module 204 completes thetraversal of span 701, it proceeds to the next span 702. During thetraversal of each span, pixels from the next span are referenced inorder to determine Δu_(vert) and Δv_(vert) in similar manner to thatdescribed above for FIG. 8. Thus, during rendering of span 701, pixelsfrom span 702 are examined for LOD selection; similarly, duringrendering of span 702, pixels from span 703 are examined. The traversalpath shown in FIG. 10A avoids the approximation described above inconnection with FIG. 8, by providing, for each pixel, the (u,v) valuesfor the pixels immediately to the right and below the pixel. However,the path of FIG. 10A may entail additional computational overhead whencompared with the path of FIG. 8, since twice as many (u,v) values aredetermined per span.

Referring now to FIG. 10B, there is shown another alternative zig-zagtraversal path. In this embodiment, a pair of spans is rendered duringone pass, so that repetitive determination of (u,v) values is avoided.Thus, span walk module 204 performs material value determination andrendering for spans 701 and 702 in one pass, using the zig-zag traversalpath shown. Thus, (u,v) values for each pixel for LOD selection areavailable using the pipelining techniques above. Unlike the traversalpath of FIG. 10A, once a pixel is processed as part of a zig-zag path,it need not be processed a second time for the succeeding span. Thus,the method of FIG. 10B avoids the approximation described in connectionwith FIG. 8, and also avoids the additional computational overhead thatmay be required for the traversal path of FIG. 10A.

From the above description, it will be apparent that the inventiondisclosed herein provides a novel and advantageous system and method ofselecting a level of detail in a texture mapping operation withoutintroducing undue computational burden. The foregoing discussiondiscloses and describes merely exemplary methods and embodiments of thepresent invention. As will be understood by those familiar with the art,the invention may be embodied in other specific forms without departingfrom the spirit or essential characteristics thereof. For example, otherarchitectures and traversal paths may be used. Accordingly, thedisclosure of the present invention and example figures are intended tobe illustrative, but not limiting, of the scope of the invention, whichis set forth in the following claims.

What is claimed is:
 1. In a texture-mapping system, a method of selecting a level of detail of a texture map for rendering a primitive, the primitive having at least one span, each span having at least one pixel, comprising:(a) selecting a first pixel in a span of the primitive; (b) determining texture map coordinates corresponding to the first pixel; (c) determining horizontal and vertical change values for texture map coordinates corresponding to the first pixel; (d) responsive to the horizontal and vertical change values, selecting a level of detail for the first pixel; (e) texture-mapping the first pixel according to the selected level of detail; and (f) repeating (a) through (e) for a second pixel in the span, wherein the repetition of (b) comprises retrieving previously determined texture map coordinates.
 2. The method of claim 1, wherein (c) comprises:(c.1) determining second texture map coordinates corresponding to a second pixel in the primitive; (c.2) determining third texture map coordinates corresponding to a third pixel in the primitive; (c.3) determining a vertical change value from the difference between the first and second texture map coordinates; and (c.4) determining a horizontal change value from the difference between the first and third texture map coordinates.
 3. The method of claim 2, wherein the second pixel in the primitive is located in a span adjacent to the span of the first pixel, and the third pixel in the primitive is located in the span of the first pixel.
 4. The method of claim 3, wherein the second pixel in the primitive is vertically adjacent to the first pixel, and the third pixel in the primitive is located two pixels away from the first pixel in the span of the first pixel.
 5. The method of claim 3, wherein the second pixel in the primitive is vertically adjacent to the first pixel, and the third pixel in the primitive is horizontally adjacent to the first pixel.
 6. The method of claim 2, wherein the third pixel in the primitive corresponds to the second pixel in the span.
 7. The method of claim 1, wherein (d) comprises:(d.1) determining a maximum value from the horizontal and vertical change values; (d.2) determining a logarithm of the maximum value; and (d.3) selecting a level of detail responsive to the value of the logarithm.
 8. The method of claim 1, wherein step (e) is performed simultaneously with step (f) using pipelining.
 9. The method of claim 1, further comprising determining at least one material value for the first pixel and rendering the first pixel using the at least one determined material value.
 10. The method of claim 9, further comprising:(h.1) determining at least one material value for each of the selected and second pixels; and wherein (i) comprises texture mapping and rendering the selected and second pixels using the retrieved portions of the texture map and the determined material values.
 11. In a texture-mapping system, a method of selecting a level of detail of a texture map for rendering a primitive, the primitive having at least one span, each span having at least one pixel, comprising:(a) selecting a pixel in a span of the primitive; (b) determining texture map coordinates corresponding to the selected pixel; (c) determining texture map coordinates corresponding to a second pixel located vertically adjacent to the selected pixel; (d) determining texture map coordinates corresponding to a fourth pixel located two pixels away from the selected pixel in a horizontal direction; (e) determining, from the results of (b) and (c), a vertical change value; (f) determining, from the results of (b) and (d), a horizontal change value; (g) responsive to the results of (e) and (f), selecting a level of detail; (h) retrieving first and second selected portions of a texture map corresponding to the selected level of detail and to the texture map coordinates corresponding to the selected pixel and to a third pixel horizontally adjacent to the selected pixel; (i) texture mapping the selected and third pixels using the retrieved portions of the texture map; (j) designating the fourth pixel as the selected pixel; (k) retrieving previously determined texture map coordinates corresponding to the selected pixel; and (l) repeating (c) through (i) for the selected pixel.
 12. The method of claim 11, further comprising:(b.1) determining at least one material value corresponding to the selected pixel; and (c.1) determining at least one material value corresponding to the third pixel; and wherein (i) comprises texture mapping and rendering the selected and third pixels using the retrieved portions of the texture map and the determined material values.
 13. In a texture-mapping system, a method of selecting a level of detail of a texture map for rendering a primitive, the primitive having at least one span, each span having at least one pixel, comprising:(a) selecting a pixel in a span of the primitive; (b) determining texture map coordinates corresponding to the selected pixel; (c) determining texture map coordinates corresponding to a second pixel located vertically adjacent to the selected pixel; (d) determining texture map coordinates corresponding to a third pixel located horizontally adjacent to the selected pixel; (e) determining, from the results of (b) and (c), a vertical change value; (f) determining, from the results of (b) and (d), a horizontal change value; (g) responsive to the results of (e) and (f), selecting a level of detail; (h) retrieving first and second selected portions of a texture map corresponding to the selected level of detail and to the texture map coordinates corresponding to the selected and second pixels; (i) texture mapping the selected and second pixels using the retrieved portions of the texture map; (j) designating the third pixel as the selected pixel; (k) retrieving previously determined texture map coordinates corresponding to the selected pixel; and (l) repeating (c) through (i) for the selected pixel.
 14. A computer-implemented system for selecting a level of detail of a texture map for rendering a primitive, the primitive having at least one span, each span having at least one pixel, comprising:a span walk module for selecting a first pixel in a span of the primitive, determining texture map coordinates corresponding to the first pixel, and determining horizontal and vertical change values for texture map coordinates corresponding to the first pixel; a level of detail selector, coupled to the span walk module, for, responsive to the horizontal and vertical change values, selecting a level of detail for the first pixel; and a texture mapping module, coupled to the level of detail selector, for texture-mapping the first pixel according to the selected level of detail; wherein: the span walk module selects a second pixel in the span, retrieves previously determine texture map coordinates corresponding to the second pixel, and determines horizontal and vertical change values for texture map coordinates corresponding to the first pixel; and wherein the level of detail selector selects a level of detail for the second pixel; and wherein the texture mapping module texture-maps the second pixel.
 15. The computer-implemented system of claim 14, wherein the level of detail selector comprises:a texture map coordinate determination module for determining second texture map coordinates corresponding to a second pixel in the primitive, and for determining third texture map coordinates corresponding to a third pixel in the primitive; and a vertical change value determination module coupled to the texture map coordinate determination module, for determining a vertical change value from the difference between the first and second texture map coordinates, and for determining a horizontal change value from the difference between the first and third texture map coordinates.
 16. The computer-implemented system of claim 14, further comprising:a material value determination module, coupled to the span walk module, for determining at least one material value for the first pixel; and a renderer, coupled to the material value determination module, for rendering the first pixel using the at least one determined material value. 